<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/25 0025
 * Time: 12:11
 */
namespace app\index\controller;

use think\Controller;

class RedisOrder extends Controller {



    //redis 下单
    public function redis_down_order($room){

        //用任务task_key_id做key的队列
        $redis_key_one = "task_goods_key".input("task_key_id")."_one";//房间1
        $redis_key_tow = "task_goods_key".input("task_key_id")."_tow";//房间1
        $key = "";
        if($room=="1"){//房间1
            $key = $redis_key_one;
        }elseif($room=="2"){//房间2
            $key = $redis_key_tow;
        }
        $connect_params = [
            "port"=>6379,
            "host"=>"127.0.0.1",
            "auth"=>"abnsj"
        ];
        //把长度放到key中做值
        $redis = new RedisManager($connect_params);

        if(!$redis->exists($key)) {//判断key值是否存在

            $redis->hSet();

        }
    }


}